home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / PInterfaces / Dictionary.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  4.3 KB  |  138 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Dictionary.p
  3.  
  4.      Contains:    Dictionary Manager Interfaces
  5.  
  6.      Version:    Technology:    System 7
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT Dictionary;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __DICTIONARY__}
  27. {$SETC __DICTIONARY__ := 1}
  28.  
  29. {$I+}
  30. {$SETC DictionaryIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __MACTYPES__}
  34. {$I MacTypes.p}
  35. {$ENDC}
  36. {$IFC UNDEFINED __FILES__}
  37. {$I Files.p}
  38. {$ENDC}
  39.  
  40.  
  41. {$PUSH}
  42. {$ALIGN MAC68K}
  43. {$LibExport+}
  44.  
  45.  
  46.  
  47. CONST
  48.                                                                 {  Dictionary data insertion modes  }
  49.     kInsert                        = 0;                            {  Only insert the input entry if there is nothing in the dictionary that matches the key.  }
  50.     kReplace                    = 1;                            {  Only replace the entries which match the key with the input entry.  }
  51.     kInsertOrReplace            = 2;                            {  Insert the entry if there is nothing in the dictionary which matches the key, otherwise replaces the existing matched entries with the input entry.  }
  52.  
  53. { This Was InsertMode }
  54.  
  55. TYPE
  56.     DictionaryDataInsertMode            = INTEGER;
  57.  
  58. CONST
  59.                                                                 {  Key attribute constants  }
  60.     kIsCaseSensitive            = $10;                            {  case sensitive = 16         }
  61.     kIsNotDiacriticalSensitive    = $20;                            {  diac not sensitive = 32     }
  62.  
  63.                                                                 {  Registered attribute type constants.     }
  64.     kNoun                        = -1;
  65.     kVerb                        = -2;
  66.     kAdjective                    = -3;
  67.     kAdverb                        = -4;
  68.  
  69. { This Was AttributeType }
  70.  
  71. TYPE
  72.     DictionaryEntryAttribute            = SInt8;
  73. { Dictionary information record }
  74.     DictionaryInformationPtr = ^DictionaryInformation;
  75.     DictionaryInformation = RECORD
  76.         dictionaryFSSpec:        FSSpec;
  77.         numberOfRecords:        SInt32;
  78.         currentGarbageSize:        SInt32;
  79.         script:                    ScriptCode;
  80.         maximumKeyLength:        SInt16;
  81.         keyAttributes:            SInt8;
  82.     END;
  83.  
  84.     DictionaryAttributeTablePtr = ^DictionaryAttributeTable;
  85.     DictionaryAttributeTable = PACKED RECORD
  86.         datSize:                UInt8;
  87.         datTable:                ARRAY [0..0] OF DictionaryEntryAttribute;
  88.     END;
  89.  
  90. FUNCTION InitializeDictionary({CONST}VAR theFsspecPtr: FSSpec; maximumKeyLength: SInt16; keyAttributes: SInt8; script: ScriptCode): OSErr;
  91.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  92.     INLINE $303C, $0500, $AA53;
  93.     {$ENDC}
  94. FUNCTION OpenDictionary({CONST}VAR theFsspecPtr: FSSpec; accessPermission: SInt8; VAR dictionaryReference: SInt32): OSErr;
  95.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  96.     INLINE $303C, $0501, $AA53;
  97.     {$ENDC}
  98. FUNCTION CloseDictionary(dictionaryReference: SInt32): OSErr;
  99.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  100.     INLINE $303C, $0202, $AA53;
  101.     {$ENDC}
  102. FUNCTION InsertRecordToDictionary(dictionaryReference: SInt32; key: Str255; recordDataHandle: Handle; whichMode: DictionaryDataInsertMode): OSErr;
  103.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  104.     INLINE $303C, $0703, $AA53;
  105.     {$ENDC}
  106. FUNCTION DeleteRecordFromDictionary(dictionaryReference: SInt32; key: Str255): OSErr;
  107.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  108.     INLINE $303C, $0404, $AA53;
  109.     {$ENDC}
  110. FUNCTION FindRecordInDictionary(dictionaryReference: SInt32; key: Str255; requestedAttributeTablePointer: DictionaryAttributeTablePtr; recordDataHandle: Handle): OSErr;
  111.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  112.     INLINE $303C, $0805, $AA53;
  113.     {$ENDC}
  114. FUNCTION FindRecordByIndexInDictionary(dictionaryReference: SInt32; recordIndex: SInt32; requestedAttributeTablePointer: DictionaryAttributeTablePtr; VAR recordKey: Str255; recordDataHandle: Handle): OSErr;
  115.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  116.     INLINE $303C, $0A06, $AA53;
  117.     {$ENDC}
  118. FUNCTION GetDictionaryInformation(dictionaryReference: SInt32; VAR theDictionaryInformation: DictionaryInformation): OSErr;
  119.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  120.     INLINE $303C, $0407, $AA53;
  121.     {$ENDC}
  122. FUNCTION CompactDictionary(dictionaryReference: SInt32): OSErr;
  123.     {$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
  124.     INLINE $303C, $0208, $AA53;
  125.     {$ENDC}
  126.  
  127.  
  128. {$ALIGN RESET}
  129. {$POP}
  130.  
  131. {$SETC UsingIncludes := DictionaryIncludes}
  132.  
  133. {$ENDC} {__DICTIONARY__}
  134.  
  135. {$IFC NOT UsingIncludes}
  136.  END.
  137. {$ENDC}
  138.